<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

	<title>Class: ProfilesController</title>

	<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />

	<script src="./js/jquery.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/thickbox-compressed.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/quicksearch.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="./js/darkfish.js" type="text/javascript"
		charset="utf-8"></script>

</head>
<body class="class">

	<div id="metadata">
		<div id="home-metadata">
			<div id="home-section" class="section">
        <h3 class="section-header">
          <a href="./index.html">Home</a>
          <a href="./index.html#classes">Classes</a>
          <a href="./index.html#methods">Methods</a>
        </h3>
			</div>
		</div>

		<div id="file-metadata">
			<div id="file-list-section" class="section">
				<h3 class="section-header">In Files</h3>
				<div class="section-body">
					<ul>
					
						<li><a href="./app/controllers/profiles_controller_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
							class="thickbox" title="app/controllers/profiles_controller.rb">app/controllers/profiles_controller.rb</a></li>
					
					</ul>
				</div>
			</div>

			
		</div>

		<div id="class-metadata">

			<!-- Parent Class -->
			
			<div id="parent-class-section" class="section">
				<h3 class="section-header">Parent</h3>
				
				<p class="link"><a href="ApplicationController.html">ApplicationController</a></p>
				
			</div>
			

			<!-- Namespace Contents -->
			

			<!-- Method Quickref -->
			
			<div id="method-list-section" class="section">
				<h3 class="section-header">Methods</h3>
				<ul class="link-list">
					
					<li><a href="#method-i-create">#create</a></li>
					
					<li><a href="#method-i-destroy">#destroy</a></li>
					
					<li><a href="#method-i-exists%3F">#exists?</a></li>
					
					<li><a href="#method-i-get">#get</a></li>
					
					<li><a href="#method-i-index">#index</a></li>
					
					<li><a href="#method-i-update">#update</a></li>
					
				</ul>
			</div>
			

			<!-- Included Modules -->
			
		</div>

		<div id="project-metadata">
			
			
			<div id="fileindex-section" class="section project-section">
				<h3 class="section-header">Files</h3>
				<ul>
				
					<li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a></li>
				
				</ul>
			</div>
			

			<div id="classindex-section" class="section project-section">
				<h3 class="section-header">Class Index
					<span class="search-toggle"><img src="./images/find.png"
						height="16" width="16" alt="[+]"
						title="show/hide quicksearch" /></span></h3>
				<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
				<fieldset>
					<legend>Quicksearch</legend>
					<input type="text" name="quicksearch" value=""
						class="quicksearch-field" />
				</fieldset>
				</form>

				<ul class="link-list">
				
					<li><a href="./Tools.html">Tools</a></li>
				
					<li><a href="./Tools/Image.html">Tools::Image</a></li>
				
					<li><a href="./Tools/ImagesController.html">Tools::ImagesController</a></li>
				
					<li><a href="./Tools/ImagesHelper.html">Tools::ImagesHelper</a></li>
				
					<li><a href="./ApplicationController.html">ApplicationController</a></li>
				
					<li><a href="./ApplicationHelper.html">ApplicationHelper</a></li>
				
					<li><a href="./AssocProfileType.html">AssocProfileType</a></li>
				
					<li><a href="./AssocProfileTypesController.html">AssocProfileTypesController</a></li>
				
					<li><a href="./AssocProfileTypesHelper.html">AssocProfileTypesHelper</a></li>
				
					<li><a href="./AssocWorkspaceProfile.html">AssocWorkspaceProfile</a></li>
				
					<li><a href="./AssocWorkspaceProfilesController.html">AssocWorkspaceProfilesController</a></li>
				
					<li><a href="./AssocWorkspaceProfilesHelper.html">AssocWorkspaceProfilesHelper</a></li>
				
					<li><a href="./Document.html">Document</a></li>
				
					<li><a href="./DocumentsController.html">DocumentsController</a></li>
				
					<li><a href="./DocumentsHelper.html">DocumentsHelper</a></li>
				
					<li><a href="./EditionArea.html">EditionArea</a></li>
				
					<li><a href="./Eo.html">Eo</a></li>
				
					<li><a href="./EoType.html">EoType</a></li>
				
					<li><a href="./EoTypesController.html">EoTypesController</a></li>
				
					<li><a href="./EoTypesHelper.html">EoTypesHelper</a></li>
				
					<li><a href="./InstructionBox.html">InstructionBox</a></li>
				
					<li><a href="./PagesController.html">PagesController</a></li>
				
					<li><a href="./PagesHelper.html">PagesHelper</a></li>
				
					<li><a href="./Profile.html">Profile</a></li>
				
					<li><a href="./ProfilesController.html">ProfilesController</a></li>
				
					<li><a href="./ProfilesHelper.html">ProfilesHelper</a></li>
				
					<li><a href="./PropertyBox.html">PropertyBox</a></li>
				
					<li><a href="./ToolBox.html">ToolBox</a></li>
				
					<li><a href="./Workspace.html">Workspace</a></li>
				
					<li><a href="./WorkspacesController.html">WorkspacesController</a></li>
				
					<li><a href="./WorkspacesHelper.html">WorkspacesHelper</a></li>
				
				</ul>
				<div id="no-class-search-results" style="display: none;">No matching classes.</div>
			</div>

			
		</div>
	</div>

	<div id="documentation">
		<h1 class="class">ProfilesController</h1>

		<div id="description">
			
		</div>

		<!-- Constants -->
		

		<!-- Attributes -->
		

		<!-- Methods -->
		
		<div id="public-instance-method-details" class="method-section section">
			<h3 class="section-header">Public Instance Methods</h3>

		
			<div id="create-method" class="method-detail ">
				<a name="method-i-create"></a>

				<div class="method-heading">
				
					<span class="method-name">create</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					
					

					
					<div class="method-source-code"
						id="create-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/profiles_controller.rb, line 2</span>
 2:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>
 3:     <span class="ruby-comment cmt"># Getting parameters</span>
 4:     <span class="ruby-identifier">json_str</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:json</span>]
 5:     <span class="ruby-identifier">as_json</span> = <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">JSON</span>
 6:     
 7:     <span class="ruby-identifier">json</span> = <span class="ruby-identifier">as_json</span>.<span class="ruby-identifier">decode</span>(<span class="ruby-identifier">json_str</span>)
 8:     
 9:     <span class="ruby-identifier">profile</span> = <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">new</span>
10:     <span class="ruby-identifier">profile</span>.<span class="ruby-identifier">update_with_json</span>(<span class="ruby-identifier">json</span>)
11:         
12:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
13:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span>  { <span class="ruby-identifier">render</span> <span class="ruby-value">:json</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">profile</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">profile</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>}
14:     <span class="ruby-keyword kw">end</span>
15:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="destroy-method" class="method-detail ">
				<a name="method-i-destroy"></a>

				<div class="method-heading">
				
					<span class="method-name">destroy</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					
					

					
					<div class="method-source-code"
						id="destroy-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/profiles_controller.rb, line 32</span>
32:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">destroy</span>
33:     <span class="ruby-identifier">profile</span> = <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
34:     <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">destroy</span>(<span class="ruby-identifier">profile</span>)
35:     
36:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
37:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span>  { <span class="ruby-identifier">render</span> <span class="ruby-value">:json</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>}
38:     <span class="ruby-keyword kw">end</span>
39:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="exists--method" class="method-detail ">
				<a name="method-i-exists%3F"></a>

				<div class="method-heading">
				
					<span class="method-name">exists?</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					
					

					
					<div class="method-source-code"
						id="exists--source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/profiles_controller.rb, line 66</span>
66:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exists?</span>
67:     <span class="ruby-identifier">profile</span> = <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">find_by_id</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])    
68:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
69:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span>  { <span class="ruby-identifier">render</span> <span class="ruby-value">:json</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">profile</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">true</span>}
70:     <span class="ruby-keyword kw">end</span>
71:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="get-method" class="method-detail ">
				<a name="method-i-get"></a>

				<div class="method-heading">
				
					<span class="method-name">get</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					
					

					
					<div class="method-source-code"
						id="get-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/profiles_controller.rb, line 58</span>
58:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>
59:     <span class="ruby-identifier">profile</span> = <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])   
60:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
61:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span>  { <span class="ruby-identifier">render</span> <span class="ruby-value">:json</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">profile</span>.<span class="ruby-identifier">to_hash</span>}
62:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">render</span> <span class="ruby-value">:xml</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">profile</span>.<span class="ruby-identifier">to_hash</span>}
63:     <span class="ruby-keyword kw">end</span>
64:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="index-method" class="method-detail ">
				<a name="method-i-index"></a>

				<div class="method-heading">
				
					<span class="method-name">index</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					
					

					
					<div class="method-source-code"
						id="index-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/profiles_controller.rb, line 41</span>
41:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span>
42:     <span class="ruby-identifier">profiles</span> = <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">all</span>
43:     <span class="ruby-identifier">all_profiles_array</span> = []
44:     <span class="ruby-identifier">profiles_hash</span> = {}
45:     
46:     <span class="ruby-identifier">profiles</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">profile</span><span class="ruby-operator">|</span>
47:       <span class="ruby-identifier">all_profiles_array</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">profile</span>.<span class="ruby-identifier">to_hash</span> 
48:     <span class="ruby-keyword kw">end</span>
49:     
50:     <span class="ruby-identifier">profiles_hash</span>[<span class="ruby-value str">&quot;profiles&quot;</span>] = <span class="ruby-identifier">all_profiles_array</span>
51:     
52:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
53:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span>  { <span class="ruby-identifier">render</span> <span class="ruby-value">:json</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">profiles_hash</span>}
54:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">render</span> <span class="ruby-value">:xml</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">profiles_hash</span>}
55:     <span class="ruby-keyword kw">end</span>
56:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="update-method" class="method-detail ">
				<a name="method-i-update"></a>

				<div class="method-heading">
				
					<span class="method-name">update</span><span
						class="method-args">()</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					
					

					
					<div class="method-source-code"
						id="update-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/profiles_controller.rb, line 17</span>
17:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>
18:     <span class="ruby-comment cmt"># Getting parameters</span>
19:     <span class="ruby-identifier">json_str</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:json</span>]
20:     <span class="ruby-identifier">as_json</span> = <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">JSON</span>
21:     
22:     <span class="ruby-identifier">json</span> = <span class="ruby-identifier">as_json</span>.<span class="ruby-identifier">decode</span>(<span class="ruby-identifier">json_str</span>)
23:     
24:     <span class="ruby-identifier">profile</span> = <span class="ruby-constant">Profile</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>])
25:     <span class="ruby-identifier">profile</span>.<span class="ruby-identifier">update_with_json</span>(<span class="ruby-identifier">json</span>)
26:     
27:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
28:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">js</span>  { <span class="ruby-identifier">render</span> <span class="ruby-value">:json</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>}
29:     <span class="ruby-keyword kw">end</span>
30:   <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
		</div>
	

	</div>


	<div id="rdoc-debugging-section-dump" class="debugging-section">
	
		<p>Disabled; run with --debug to generate this.</p>
	
	</div>

	<div id="validator-badges">
		<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
		<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
			Rdoc Generator</a> 1.1.6</small>.</p>
	</div>

</body>
</html>

